{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Hello NumPy, Jupyter, and Colab",
      "provenance": [],
      "authorship_tag": "ABX9TyOn4L1vlHevrHyRsKJ/AR3+",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/jalammar/jalammar.github.io/blob/master/notebooks/visual_intro_to_ml/Hello_NumPy%2C_Jupyter%2C_and_Colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "i121yKFybb0N",
        "colab_type": "text"
      },
      "source": [
        "This is a text cell"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "G2tObNjHawKA",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "# This is a code cell"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZeLQPS0AapjJ",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import numpy as np\n",
        "weight = 2\n",
        "features = np.array([1,2,4])\n",
        "label = np.array([10,20,40])\n",
        "predictions = weight * features\n",
        "error = predictions - label"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "kGlosI1waq20",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "ed0c01db-5e8f-4f06-9759-e1a5358380ad"
      },
      "source": [
        "error"
      ],
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([ -8, -16, -32])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 5
        }
      ]
    }
  ]
}